package com.api.devices.domain.vo;

import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Getter
@Setter
public class LineVo {
    private Long lineId;
    @JsonIgnore
    private String lineName;
    private JSONObject lineNameLocales;
    @JsonIgnore
    private String strLineNameLocales;
    private String linePosition;
    /**
     * 描述
     */
    private String remark;
    /**
     * 创建时间
     */
    @JsonIgnore
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 创建人
     */
    @JsonIgnore
    private String createBy;
    /**
     * 更新时间
     */
    @JsonIgnore
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 更新人
     */
    @JsonIgnore
    private String updateBy;
    /**
     * 选择第N页
     */
    @JsonIgnore
    private int pageNum;
    /**
     * 每页显示量
     */
    @JsonIgnore
    private int pageSize;

    @JsonIgnore
    private String appLang;

    public String getStrLineNameLocales() {return lineNameLocales.toString();}

    public void initControl(String username, String appLang) {
        this.appLang = appLang;
        this.updateBy = username;
        this.createBy = username;
    }
}
